{extend name="$_admin_base_layout" /}

{block name="content"}
<script src="__ADMIN_JS__/core/jquery.min.js?v={:config('asset_version')}"></script>
{notempty name="page_tips_top"}
<div class="alert alert-{$tips_type} alert-dismissable">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <p>{$page_tips_top|raw}</p>
</div>
{/notempty}
<div class="row">
    <div class="col-md-12">
        {$extra_html_block_top|raw|default=''}
        <div class="block">
            {notempty name="tab_nav"}
            <ul class="nav nav-tabs">
                {volist name="tab_nav['tab_list']" id="tab"}
                <li {eq name="tab_nav.curr_tab" value="$key"}class="active"{/eq}>

                <a href="{$tab.url}{$_pop ?= '?_pop=1'}">
                    {present name="tab.count"}
                    {gt name="tab.count" value="0"}
                    <span style="width: 5px;height: 5px;border-radius: 50%;background: red;display: inline-block;"></span>
                    {/gt}
                    {/present}
                    {$tab.title|htmlspecialchars}</a>
                </li>
                {/volist}
                <li class="pull-right">
                    <ul class="block-options push-10-t push-10-r">
                        <li>
                            <button type="button" class="page-reload"><i class="si si-refresh"></i></button>
                        </li>
                        <li>
                            <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"></button>
                        </li>
                    </ul>
                </li>
            </ul>
            {else/}
            {empty name="_pop"}
            <div class="block-header bg-gray-lighter">
                <ul class="block-options">
                    <li>
                        <button type="button" class="page-reload"><i class="si si-refresh"></i></button>
                    </li>
                    <li>
                        <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"></button>
                    </li>
                </ul>

                <h3 class="block-title">

                    {present name="count"}
                    {gt name="count" value="0"}
                    <span style="width: 5px;height: 5px;border-radius: 50%;background: red;display: inline-block;"></span>
                    {/gt}
                    {/present}

                    {$page_title|default=""|htmlspecialchars}</h3>
            </div>
            {/empty}
            {/notempty}
            <div class="block-content tab-content">
                <div class="tab-pane active">
                    {notempty name="_search_area"}
                    <div class="search-area border-b push">
                        <input type="hidden" id="_o" value="{$_search_area_op|default=''}">
                        <form action="{$_search_area_url}" class="form-horizontal row" id="search-area">
                            {volist name="_search_area" id="vo"}
                            {switch name="vo[0]"}
                            {case value="text"}
                            <div class="col-md-{$_search_area_layout[$vo.1]|default='3'} col-xs-12 push">
                                <div class="input-group">
                                    <span class="input-group-addon">{$vo.2|default=''}</span>
                                    <input class="form-control" type="{$vo.0|default='text'}" id="search_{$vo.1|default=''}" name="{$vo.1|default=''}" value="{$vo.4|default=''}" placeholder="{$vo.2|default=''}">
                                </div>
                            </div>
                            {/case}
                            {case value="select"}
                            <div class="col-md-{$_search_area_layout[$vo.1]|default='3'} col-xs-12 push">
                                <div class="input-group">
                                    <span class="input-group-addon">{$vo.2|default=''}</span>
                                    <select class="js-select2 form-control" id="search_{$vo.1|default=''}" name="{$vo.1|default=''}" data-width="resolve" data-allow-clear="true" data-placeholder="{$vo.2|default=''}">
                                        <option></option>
                                        {notempty name="vo.5"}
                                        {volist name="vo.5" id="v"}
                                        <option value="{$key}" {if ((string)$vo.4 == (string)$key)}selected{/if}>{$v|raw}</option>
                                        {/volist}
                                        {/notempty}
                                    </select>
                                </div>
                            </div>
                            {/case}
                            {case value="daterange"}
                            <div class="col-md-{$_search_area_layout[$vo.1]|default='3'} col-xs-12 push">
                                <div class="input-group">
                                    <span class="input-group-addon">{$vo.2|default=''}</span>
                                    <input class="js-daterangepicker form-control" type="text" id="search_{$vo.1|default=''}" name="{$vo.1|default=''}" value="{$vo.4|default=''}" placeholder="{$vo.2|default=''}" {$vo.5|raw|default=""}>
                                </div>
                            </div>
                            {/case}
                            {/switch}
                            {/volist}
                            <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                <div class="form-group">
                                    <div class="col-md-12">
                                        <button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 搜索</button>
                                        <a href="{$_search_area_url}" class="btn btn-sm btn-default" type="reset"><i class="fa fa-reply"></i> 重置</a>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    {/notempty}

                    {// 顶部筛选及搜索 }
                    {$extra_html_toolbar_top|raw|default=''}
                    <div class="row data-table-toolbar">
                        <div class="col-sm-12">
                            {// 搜索框 }
                            {notempty name="multi_search"}
                            <div class="pull-right search-bar" style="width: auto;max-width: 1000px;">
                                <form method="get" action="{$multi_search.url}" id="multi-search-form">
                                    <div class="input-group">

                                        <?php  foreach($multi_search['condition'] as $k=>$v){
                                        switch ($v['type']){?>
                                        <?php case "text":?>
                                        <input type="text" name="{$v['field']}" placeholder="{$v['place']}" class="form-control" style="display:inline-block;width:150px;" value="{$v['default']}" />
                                        <?php break; ?>
                                        <?php case "hidden":?>
                                        <input type="hidden" name="{$v['field']}" placeholder="{$v['place']}" class="form-control" style="display:inline-block;width:150px;" value="{$v['default']}" />
                                        <?php break; ?>
                                        <?php case "select":?>

                                        <select  name="{$v['field']}" placeholder="{$v['place']}" class="form-control" style="display:inline-block;width:150px;">
                                            {foreach $v['options'] as $k2=>$v2}
                                            <option value="{$k2}" <?php echo $k2==$v['default']?'selected':'';?> >{$v2}</option>
                                            {/foreach}

                                        </select>

                                        <?php break; ?>
                                        <?php case "date":?>
                                        <input type="text"  name="{$v['field']}"  value="{$v['default']}"  placeholder="{$v['place']}" class="datepicker form-control" style="display:inline-block;width:150px;" />



                                        <?php break; ?>

                                        <?php  }
                                        }
                                    ?>
                                        <input type="hidden" class="form-control"  data-url="{$multi_search.url}" id="search-input" />


                                        <button class="btn btn-default"     type="submit">搜索</button>
                                    </div>
                                </form>

                            </div>

                            <!--  <script type="text/javascript" src="__LIBS__/bootstrap-datepicker/locales/bootstrap-datepicker.min.js"></script>
                             <script type="text/javascript" src="__LIBS__/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script> -->
                            <script type="text/javascript">
                                $(function () {
                                    $.each($(".datepicker"),function(i,v){
                                        $(v).datepicker({
                                            language: "zh-CN",
                                            autoclose: true,//选中之后自动隐藏日期选择框
                                            clearBtn: true,//清除按钮
                                            todayBtn: true,//今日按钮
                                            value:$(v).val(),
                                            format: "yyyy-mm-dd"//日期格式
                                        });
                                    })

                                });
                            </script>
                            {/notempty}
                            {notempty name="search"}
                            <div class="pull-right search-bar">
                                <input type="hidden" name="search_field" id="search-field" value="{php}echo input('param.search_field', '') == '' ? $search['field_all'] : input('param.search_field');{/php}">
                                <div class="input-group">
                                    <div class="input-group-btn">
                                        <button class="btn btn-default" id="search-btn" data-toggle="dropdown" type="button" aria-expanded="false">
                                            不限 <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a tabindex="-1" href="javascript:void(0)" data-field="{$search.field_all}">不限</a>
                                            </li>
                                            {volist name="search.fields" id="field"}
                                            <li>
                                                <a tabindex="-1" href="javascript:void(0)" data-field="{$key}">{$field|htmlspecialchars}</a>
                                            </li>
                                            {/volist}
                                        </ul>
                                    </div>
                                    <div {$search_button ?= 'class="input-group"'}>
                                        <input type="text" class="form-control" value="{:input('param.keyword', '')}" data-url="{$search.url}" id="search-input" name="keyword" placeholder="{$search.placeholder}">
                                        {$search_button ?= '<span class="input-group-btn"><button class="btn btn-default" id="search-submit-btn" type="button">'.($search_button === true ? "搜索" : $search_button).'</button></span>'}
                                    </div>

                                </div>
                            </div>
                            {/notempty}

                            {// 顶部按钮 }
                            <div class="toolbar-btn-action">
                                {if (!empty($top_buttons))}
                                {volist name="top_buttons" id="button"}
                                {$button|raw}
                                {/volist}
                                {/if}

                                {// 下拉菜单}
                                {notempty name="_select_list"}
                                <div class="form-inline" style="display: inline-block;">
                                    {volist name="_select_list" id="item"}
                                    <select class="js-select2 form-control select-change select-search" data-width="resolve" id="select-{$item.name}">
                                        {notempty name="item.title"}
                                        <option value="" data-url="{$item.default_url}">{$item.title|default=''}</option>
                                        {/notempty}
                                        {volist name="item['options']" id="option"}
                                        <option value="{$key}" {php}if($item['current'] != '' && $item['current'] == $key){echo 'selected';}{/php}
                                        {php}if(is_array($item['url'])):{/php}
                                        data-url='{$item['url'][$key]|raw}'
                                        {php}endif;{/php}
                                        >{$option}</option>
                                        {/volist}
                                    </select>
                                    {/volist}
                                </div>
                                {/notempty}

                                {// 时间段搜索}
                                {notempty name="_filter_time"}
                                <div class="form-inline time-filter">
                                    <div class="time-filter">
                                        <div class="input-daterange input-group" data-date-format="yyyy-mm-dd">
                                            <input class="form-control" type="text" id="_filter_time_from" name="_filter_time_from" value="{$Request.get._filter_time_from ? $Request.get._filter_time_from : $_filter_time.date_start}" placeholder="{$_filter_time.tips_start}">
                                            <span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>
                                            <input class="form-control" type="text" id="_filter_time_to" name="_filter_time_to" value="{$Request.get._filter_time_to ? $Request.get._filter_time_to : $_filter_time.date_end}" placeholder="{$_filter_time.tips_end}">
                                        </div>
                                        <input type="hidden" id="_filter_time" name="_filter_time" value="{$_filter_time.field}">
                                        <button type="button" id="btn-filter-time" class="btn btn-default">确定</button>
                                    </div>
                                </div>
                                {/notempty}
                            </div>
                        </div>
                    </div>
                    <div>
                        <div style="font-size: 16px;padding: 10px"><span style="padding: 0 20px">收入 {$income}</span><span style="padding: 0 20px">支出 {$expenditure}</span><span style="padding: 0 20px">余额 {$balance}</span></div>
                    </div>
                    {$extra_html_toolbar_bottom|raw|default=''}
                    <div class="builder-table-wrapper" id="builder-table-wrapper">
                        <div class="builder-table" id="builder-table">
                            {$extra_html_table_top|raw|default=''}
                            <div class="builder-table-head" id="builder-table-head">
                                <table class="table table-builder table-hover table-bordered table-striped js-table-checkable">
                                    <colgroup>
                                        {if (!$hide_checkbox)}
                                        <col>
                                        {/if}
                                        {volist name="columns" id="column"}
                                        <col class="{$column_hide[$column['name']]|default=''}">
                                        {/volist}
                                    </colgroup>
                                    <thead>
                                    <tr>
                                        {if (!$hide_checkbox)}
                                        <th class="text-center">
                                            <label class="css-input css-checkbox css-checkbox-primary remove-margin-t remove-margin-b">
                                                <input type="checkbox" id="check-all"><span></span>
                                            </label>
                                        </th>
                                        {/if}

                                        {volist name="columns" id="column"}
                                        <th class="column-{$column['name']} {$column_hide[$column['name']]|default=''} {$column.class|default=''}">
                                            {// 字段标题}
                                            {$column.title|default=''|htmlspecialchars}
                                            <span>
                                                {// 排序功能}
                                                {php}if (isset($order_columns[$column['name']])): {/php}
                                                    {php}
                                                        $_by = input('param._by') == 'asc' ? 'desc' : 'asc';
                                                        $_param = array_merge(input('get.'), ['_by' => $_by, '_order' => $order_columns[$column['name']]]);
                                                        if ($_param) {
                                                            $_get = [];
                                                            foreach ($_param as $key => $value) {
                                                                $_get[] = $key. '=' .$value;
                                                            }
                                                            $_get = '?'.implode('&', $_get);
                                                        }
                                                    {/php}
                                                    <a href="{$Request.baseUrl}{$_get}" data-toggle="tooltip" data-original-title="排序">
                                                        {php}
                                                            if (input('param._order') == $order_columns[$column['name']]) {
                                                                echo input('param._by') == 'asc' ? '<i class="fa fa-caret-up"></i>' : '<i class="fa fa-caret-down"></i>';
                                                            } else {
                                                                echo '<i class="fa fa-sort text-muted"></i>';
                                                            }
                                                        {/php}
                                                    </a>
                                                {php}endif;{/php}

                                                {// 筛选功能}
                                                {php}if (isset($filter_columns[$column['name']])): {/php}
                                                {php}
                                                    if (!empty(request()->param('_field_display'))) {
                                                        $_field_display = request()->param('_field_display');
                                                    }
                                                {/php}
                                                <a href="javascript:void(0);" class="field-filter" data-filter="{$filter_columns[$column['name']]['filter']}" data-list="{$filter_columns[$column['name']]['list']}" data-type="{$filter_columns[$column['name']]['type']}" data-options='{$filter_columns[$column["name"]]["options"]|default=""}' data-map='{$filter_columns[$column["name"]]["map"]|default=""}' data-field-display="{$column['name']}" data-token="{$filter_columns[$column['name']]['token']}" data-toggle="tooltip" data-original-title="筛选"><i class="fa fa-filter {notin name='column.name' value='$_field_display'}text-muted{/notin}"></i></a>
                                                {php}endif;{/php}
                                                </span>
                                        </th>
                                        {/volist}
                                    </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="builder-table-body" id="builder-table-body">
                                <table class="table table-builder table-hover table-bordered table-striped js-table-checkable-target" id="builder-table-main">
                                    <colgroup>
                                        {if (!$hide_checkbox)}
                                        <col width="50">
                                        {/if}
                                        {volist name="columns" id="column"}
                                        <col width="{$column_width[$column['name']]|default='100'}" class="{$column_hide[$column['name']]|default=''}">
                                        {/volist}
                                    </colgroup>
                                    <tbody>
                                    {volist name="row_list" id="row"}
                                    <tr class="{$row['_tr_class']|default=''}">
                                        {if (!$hide_checkbox)}
                                        <td class="text-center">
                                            <div class="table-cell">
                                                <label class="css-input css-checkbox css-checkbox-primary">
                                                    <input class="ids" type="checkbox" name="ids[]" value="{$row['_primary_key_value']|default=''}"><span></span>
                                                </label>
                                            </div>
                                        </td>
                                        {/if}

                                        {volist name="columns" id="column"}
                                        <td class="{$column['class']|default=''} {$column_hide[$column['name']]|default=''}">
                                            <div class="table-cell">
                                                {php}if(is_array($column['type']) || $column['type'] == '' || $column['type'] == 'btn' || $column['type'] == 'text'):{/php}
                                                {$row[$column['name']]|raw|default=''}
                                                {php}else:{/php}
                                                {$row[$column['name'].'__'.$column['type']]|raw|default=''}
                                                {php}endif;{/php}
                                            </div>
                                        </td>
                                        {/volist}
                                    </tr>
                                    {/volist}

                                    {empty name="row_list"}
                                    {notempty name="empty_tips"}
                                    <tr class="table-empty">
                                        {php}$colspan = count($columns)+1{/php}
                                        <td class="text-center empty-info" colspan="{$colspan}">
                                            <i class="fa fa-database"></i> {$empty_tips|raw}<br>
                                        </td>
                                    </tr>
                                    {/notempty}
                                    {/empty}
                                    </tbody>
                                </table>
                            </div>
                            {gt name="fixed_left_column" value="0"}
                            <div class="builder-table-left" id="builder-table-left">
                                <div class="builder-table-left-head" id="builder-table-left-head">
                                    <table class="table table-builder table-hover table-bordered table-striped js-table-checkable-left">
                                        <colgroup>
                                            {if (!$hide_checkbox)}
                                            <col>
                                            {/if}
                                            {volist name="columns" id="column"}
                                            <col class="{$column_hide[$column['name']]|default=''}">
                                            {/volist}
                                        </colgroup>
                                        <thead>
                                        <tr id="builder-table-left-first-tr">
                                            {if (!$hide_checkbox)}
                                            <th class="text-center">
                                                <label class="css-input css-checkbox css-checkbox-primary remove-margin-t remove-margin-b">
                                                    <input type="checkbox"><span></span>
                                                </label>
                                            </th>
                                            {/if}

                                            {volist name="columns" id="column"}
                                            <th class="column-{$column['name']} {$column_hide[$column['name']]|default=''} {$column.class|default=''}" {gt name="i" value="$fixed_left_column"}style="visibility:hidden"{/gt}>
                                            {// 字段标题}
                                            {$column.title|default=''|htmlspecialchars}
                                            <span>
                                                    {// 排序功能}
                                                    {php}if (isset($order_columns[$column['name']])): {/php}
                                                        {php}
                                                            $_by = input('param._by') == 'asc' ? 'desc' : 'asc';
                                                            $_param = array_merge(input('get.'), ['_by' => $_by, '_order' => $order_columns[$column['name']]]);
                                                            if ($_param) {
                                                                $_get = [];
                                                                foreach ($_param as $key => $value) {
                                                                    $_get[] = $key. '=' .$value;
                                                                }
                                                                $_get = '?'.implode('&', $_get);
                                                            }
                                                        {/php}
                                                        <a href="{$Request.baseUrl}{$_get}" data-toggle="tooltip" data-original-title="排序">
                                                            {php}
                                                                if (input('param._order') == $order_columns[$column['name']]) {
                                                                    echo input('param._by') == 'asc' ? '<i class="fa fa-caret-up"></i>' : '<i class="fa fa-caret-down"></i>';
                                                                } else {
                                                                    echo '<i class="fa fa-sort text-muted"></i>';
                                                                }
                                                            {/php}
                                                        </a>
                                                    {php}endif;{/php}

                                                    {// 筛选功能}
                                                    {php}if (isset($filter_columns[$column['name']])): {/php}
                                                    {php}
                                                        if (!empty(request()->param('_field_display'))) {
                                                            $_field_display = request()->param('_field_display');
                                                        }
                                                    {/php}
                                                    <a href="javascript:void(0);" class="field-filter" data-filter="{$filter_columns[$column['name']]['filter']}" data-list="{$filter_columns[$column['name']]['list']}" data-type="{$filter_columns[$column['name']]['type']}" data-options='{$filter_columns[$column["name"]]["options"]|default=""}' data-map='{$filter_columns[$column["name"]]["map"]|default=""}' data-field-display="{$column['name']}" data-token="{$filter_columns[$column['name']]['token']}" data-toggle="tooltip" data-original-title="筛选"><i class="fa fa-filter {notin name='column.name' value='$_field_display'}text-muted{/notin}"></i></a>
                                                    {php}endif;{/php}
                                                    </span>
                                            </th>
                                            {/volist}
                                        </tr>
                                        </thead>
                                    </table>
                                </div>
                                <div class="builder-table-left-body" id="builder-table-left-body">
                                    <table class="table table-builder table-hover table-bordered table-striped js-table-checkable-target-left">
                                        <colgroup>
                                            {if (!$hide_checkbox)}
                                            <col>
                                            {/if}
                                            {volist name="columns" id="column"}
                                            <col class="{$column_hide[$column['name']]|default=''}">
                                            {/volist}
                                        </colgroup>
                                        <tbody>
                                        {volist name="row_list" id="row"}
                                        <tr class="{$row['_tr_class']|default=''}">
                                            {if (!$hide_checkbox)}
                                            <td class="text-center" style="width: 70px;">
                                                <label class="css-input css-checkbox css-checkbox-primary">
                                                    <input class="ids" type="checkbox" name="ids[]" value="{$row['_primary_key_value']|default=''}"><span></span>
                                                </label>
                                            </td>
                                            {/if}

                                            {volist name="columns" id="column"}
                                            <td class="{$column['class']|default=''} {$column_hide[$column['name']]|default=''}">
                                                {php}if(is_array($column['type']) || $column['type'] == '' || $column['type'] == 'btn' || $column['type'] == 'text'):{/php}
                                                {$row[$column['name']]|raw|default=''}
                                                {php}else:{/php}
                                                {$row[$column['name'].'__'.$column['type']]|raw|default=''}
                                                {php}endif;{/php}
                                            </td>
                                            {/volist}
                                        </tr>
                                        {/volist}

                                        {empty name="row_list"}
                                        {notempty name="empty_tips"}
                                        <tr class="table-empty">
                                            {php}$colspan = count($columns)+1{/php}
                                            <td class="text-center empty-info" colspan="{$colspan}">
                                                <i class="fa fa-database"></i> {$empty_tips|raw}<br>
                                            </td>
                                        </tr>
                                        {/notempty}
                                        {/empty}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            {/gt}
                            {gt name="fixed_right_column" value="0"}
                            <div class="builder-table-right" id="builder-table-right">
                                <div class="builder-table-right-head" id="builder-table-right-head">
                                    <table class="table table-builder table-hover table-bordered table-striped js-table-checkable-target">
                                        <colgroup>
                                            {if (!$hide_checkbox)}
                                            <col>
                                            {/if}
                                            {volist name="columns" id="column"}
                                            <col class="{$column_hide[$column['name']]|default=''}">
                                            {/volist}
                                        </colgroup>
                                        <thead>
                                        <tr>
                                            {if (!$hide_checkbox)}
                                            <th class="text-center">
                                                <label class="css-input css-checkbox css-checkbox-primary remove-margin-t remove-margin-b">
                                                    <input type="checkbox"><span></span>
                                                </label>
                                            </th>
                                            {/if}

                                            {volist name="columns" id="column"}
                                            <th class="column-{$column['name']} {$column_hide[$column['name']]|default=''} {$column.class|default=''}">
                                                {// 字段标题}
                                                {$column.title|default=''|htmlspecialchars}
                                                <span>
                                                        {// 排序功能}
                                                        {php}if (isset($order_columns[$column['name']])): {/php}
                                                            {php}
                                                                $_by = input('param._by') == 'asc' ? 'desc' : 'asc';
                                                                $_param = array_merge(input('get.'), ['_by' => $_by, '_order' => $order_columns[$column['name']]]);
                                                                if ($_param) {
                                                                    $_get = [];
                                                                    foreach ($_param as $key => $value) {
                                                                        $_get[] = $key. '=' .$value;
                                                                    }
                                                                    $_get = '?'.implode('&', $_get);
                                                                }
                                                            {/php}
                                                            <a href="{$Request.baseUrl}{$_get}" data-toggle="tooltip" data-original-title="排序">
                                                                {php}
                                                                    if (input('param._order') == $order_columns[$column['name']]) {
                                                                        echo input('param._by') == 'asc' ? '<i class="fa fa-caret-up"></i>' : '<i class="fa fa-caret-down"></i>';
                                                                    } else {
                                                                        echo '<i class="fa fa-sort text-muted"></i>';
                                                                    }
                                                                {/php}
                                                            </a>
                                                        {php}endif;{/php}

                                                        {// 筛选功能}
                                                        {php}if (isset($filter_columns[$column['name']])): {/php}
                                                        {php}
                                                            if (!empty(request()->param('_field_display'))) {
                                                                $_field_display = request()->param('_field_display');
                                                            }
                                                        {/php}
                                                        <a href="javascript:void(0);" class="field-filter" data-filter="{$filter_columns[$column['name']]['filter']}" data-list="{$filter_columns[$column['name']]['list']}" data-type="{$filter_columns[$column['name']]['type']}" data-options='{$filter_columns[$column["name"]]["options"]|default=""}' data-map='{$filter_columns[$column["name"]]["map"]|default=""}' data-field-display="{$column['name']}" data-token="{$filter_columns[$column['name']]['token']}" data-toggle="tooltip" data-original-title="筛选"><i class="fa fa-filter {notin name='column.name' value='$_field_display'}text-muted{/notin}"></i></a>
                                                        {php}endif;{/php}
                                                        </span>
                                            </th>
                                            {/volist}
                                        </tr>
                                        </thead>
                                    </table>
                                </div>
                                <div class="builder-table-right-body" id="builder-table-right-body">
                                    <div class="builder-table-right-body-inner" id="builder-table-right-body-inner">
                                        <table class="table table-builder table-hover table-bordered table-striped">
                                            <colgroup>
                                                {if (!$hide_checkbox)}
                                                <col>
                                                {/if}
                                                {volist name="columns" id="column"}
                                                <col class="{$column_hide[$column['name']]|default=''}">
                                                {/volist}
                                            </colgroup>
                                            <tbody>
                                            {volist name="row_list" id="row"}
                                            <tr class="{$row['_tr_class']|default=''}">
                                                {if (!$hide_checkbox)}
                                                <td class="text-center" style="width: 70px;">
                                                    <label class="css-input css-checkbox css-checkbox-primary">
                                                        <input class="ids" type="checkbox"><span></span>
                                                    </label>
                                                </td>
                                                {/if}

                                                {volist name="columns" id="column"}
                                                <td class="{$column['class']|default=''} {$column_hide[$column['name']]|default=''}">
                                                    {php}if(is_array($column['type']) || $column['type'] == '' || $column['type'] == 'btn' || $column['type'] == 'text'):{/php}
                                                    {$row[$column['name']]|raw|default=''}
                                                    {php}else:{/php}
                                                    {$row[$column['name'].'__'.$column['type']]|raw|default=''}
                                                    {php}endif;{/php}
                                                </td>
                                                {/volist}
                                            </tr>
                                            {/volist}

                                            {empty name="row_list"}
                                            {notempty name="empty_tips"}
                                            <tr class="table-empty">
                                                {php}$colspan = count($columns)+1{/php}
                                                <td class="text-center empty-info" colspan="{$colspan}">
                                                    <i class="fa fa-database"></i> {$empty_tips|raw}<br>
                                                </td>
                                            </tr>
                                            {/notempty}
                                            {/empty}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <div class="builder-table-right-header"></div>
                            {/gt}
                            {$extra_html_table_bottom|raw|default=''}
                        </div>
                    </div>
                    <div class="data-table-toolbar">
                        <div class="row">

                            <div class="col-sm-12">
                                {// 搜索框 }

                                {notempty name="total_info"}
                                {if  ($total_info['page'] <1)}
                                <div style="float: right;margin-right:30px;">
                                    {foreach $total_info['data'] as $k=>$v }
                                    <span style="padding-right: 10px;">{$v}</span>
                                    {/foreach}
                                </div>
                                {/if}
                                {/notempty}

                                {// 分页 }
                                {notempty name="pages"}
                                {$pages|raw}
                                {/notempty}
                                {notempty name="_page_info"}
                                <div class="pagination-info pull-right">

                                    <div style="float: right;">

                                        <input type="text" class="form-control input-sm go-page" id="go-page" name="page" value="{:input('param.page', '1')}">
                                        <input type="text" class="form-control input-sm nums" id="list-rows" name="list_rows" value="{php}echo input('param.list_rows', '') == '' ? $_page_info->listRows() : input('param.list_rows');{/php}">
                                        / <strong>{$_page_info->lastPage()|raw}</strong> 页，共 <strong>{$_page_info->total()|raw}</strong> 条数据，每页显示数量
                                    </div>
                                    {notempty name="total_info"}
                                    {if  ($total_info['page'] ==1)}
                                    <div style="float: right;margin-right:30px;">
                                        {foreach $total_info['data'] as $k=>$v }
                                        <span style="padding-right: 10px;">{$v}</span>
                                        {/foreach}
                                    </div>
                                    {/if}
                                    {/notempty}
                                </div>
                                {/notempty}
                                {notempty name="total_info"}
                                {if  ($total_info['page'] >1)}
                                <div style="float: right;margin-right:30px;font-weight: 500;">
                                    {foreach $total_info['data'] as $k=>$v }
                                    <span style="padding-right: 10px;">{$v}</span>
                                    {/foreach}
                                </div>
                                {/if}
                                {/notempty}
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        {$extra_html_block_bottom|raw|default=''}
    </div>
</div>
{notempty name="page_tips_bottom"}
<div class="alert alert-{$tips_type} alert-dismissable">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <p>{$page_tips_bottom|raw}</p>
</div>
{/notempty}
{/block}

{block name="style"}
{volist name="css_list" id="vo"}
<link rel="stylesheet" href="{$vo}?v={:config('asset_version')}">
{/volist}

{// 额外CSS代码 }
{$extra_css|raw|default=''}
{/block}

{block name="script"}
<script>
    var init_table = function() {
        var left_column = '{$fixed_left_column}';
        var right_column = '{$fixed_right_column}';
        var left_width = 0;
        var right_width = 0;
        var table_main = $('#builder-table-main');
        var table_head = $('#builder-table-head').find('table');
        var table_left_head = $('#builder-table-left-head').find('table');
        var table_left_body = $('#builder-table-left-body').find('table');
        var table_right_head = $('#builder-table-right-head').find('table');
        var table_right_body = $('#builder-table-right-body').find('table');
        var table_head_tr_td = table_main.find('tr:first-child td');
        var table_body = $('#builder-table-body');
        var table_body_col  = table_body.find('col');
        var table_body_first_tr_th_len = table_body_col.length;
        var right_column_start = table_body_first_tr_th_len - right_column;

        table_head.width(table_main.width());
        table_left_head.width(table_main.width());
        table_left_body.width(table_main.width());
        table_right_head.width(table_main.width());
        table_right_body.width(table_main.width());

        // 设置表头列宽度
        $.each(table_head_tr_td, function (i, e) {
            if (i < left_column) {
                left_width += $(this).outerWidth();
            }
            if (i >= right_column_start) {
                right_width += $(this).outerWidth();
            }
        });

        /*设置左边固定列*/
        $('#builder-table-left').width(left_width);
        /*设置右侧固定列*/
        $('#builder-table-right').width(right_width);
    };
    jQuery(window).on('resize load', function () {
        init_table();
    });

    $(document).ready(function () {
        var builder_table_head = $('#builder-table-head');
        var builder_table_left_body = $('#builder-table-left-body');
        var builder_table_right_body = $('#builder-table-right-body');
        var table_main = $('#builder-table-main');
        var table_body = $('#builder-table-body');
        var table_right = $('#builder-table-right');
        var table_head_col  = builder_table_head.find('col');
        var table_body_col  = table_body.find('col');
        var table_left_head_col  = $('#builder-table-left-head').find('col');
        var table_right_head_col = $('#builder-table-right-head').find('col');
        var table_left_body_col = builder_table_left_body.find('col');
        var table_right_body_col = builder_table_right_body.find('col');

        {switch name="builder_height"}
        {case value="fixed"}
        {empty name="_pop"}
        $('#builder-table-wrapper').css('max-height', ($(window).height() - 340)+'px');
        {else/}
            $('#builder-table-wrapper').css('max-height', ($(window).height() - 160)+'px');
            {/empty}
                {/case}
                    {case value="auto"}{/case}
                    {default/}
                        $('#builder-table-wrapper').css('height', '{$builder_height}px');
                        {/switch}

                            table_body.css('max-height', $('#builder-table-wrapper').outerHeight() - 50);

                            $.each(table_body_col, function (i, e) {
                                var width = $(this).attr('width');
                                table_head_col.eq(i).attr('width', width);
                                table_left_head_col.eq(i).attr('width', width);
                                table_left_body_col.eq(i).attr('width', width);
                                table_right_head_col.eq(i).attr('width', width);
                                table_right_body_col.eq(i).attr('width', width);
                            });

                            /* 监听滚动事件 */
                            table_body.on( 'scroll', function (e) {
                                builder_table_head.scrollLeft(this.scrollLeft);
                                builder_table_left_body.scrollTop(this.scrollTop);
                                builder_table_right_body.scrollTop(this.scrollTop);
                            });

                            if ($(window).width() > 768 && ($('#builder-table-main tbody').height() > table_body.height())) {
                                $('#builder-table-head').css('margin-right', '17px');
                                $('#builder-table-right').css('right', '17px');
                            } else {
                                $('.builder-table-right-header').hide();
                                $('#builder-table-left,#builder-table-right').hide();
                            }

                            if (table_body.width() < $('#builder-table-main').width()) {
                                builder_table_left_body.height(table_body.height() - 17);
                                builder_table_right_body.height(table_body.height() - 17);
                                table_right.height(table_body.height() + 33);
                            } else {
                                builder_table_left_body.height(table_body.height());
                                builder_table_right_body.height(table_body.height());
                                table_right.height(table_body.height() + 50);
                            }

                            /*行高亮*/
                            var table_main_tr = table_main.find('tbody tr');
                            var table_left_tr = builder_table_left_body.find('tbody tr');
                            var table_right_tr = builder_table_right_body.find('tbody tr');
                            table_main_tr.hover(function () {
                                table_left_tr.eq($(this).index()).addClass('hover');
                                table_right_tr.eq($(this).index()).addClass('hover');
                            }, function () {
                                table_left_tr.eq($(this).index()).removeClass('hover');
                                table_right_tr.eq($(this).index()).removeClass('hover');
                            });
                            table_left_tr.hover(function () {
                                table_main_tr.eq($(this).index()).addClass('hover');
                                table_right_tr.eq($(this).index()).addClass('hover');
                            }, function () {
                                table_main_tr.eq($(this).index()).removeClass('hover');
                                table_right_tr.eq($(this).index()).removeClass('hover');
                            });
                            table_right_tr.hover(function () {
                                table_main_tr.eq($(this).index()).addClass('hover');
                                table_left_tr.eq($(this).index()).addClass('hover');
                            }, function () {
                                table_main_tr.eq($(this).index()).removeClass('hover');
                                table_left_tr.eq($(this).index()).removeClass('hover');
                            });
                        });
</script>
{volist name="js_list" id="vo"}
<script src="{$vo}?v={:config('asset_version')}"></script>
{/volist}

{// 额外JS代码 }
{$extra_js|raw|default=''}
{/block}